From: Matthias Clasen Date: Tue, 12 Dec 2017 18:56:15 +0000 (-0500) Subject: placesview: Make middle click work X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~38^2~126 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=05e4e7fe879580dc3e468ea27487e563ebdcb9a0;p=gtk%2B3.0.git placesview: Make middle click work This does not cost us much, and improves consistency. --- diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index f8a2e22c6f..2a79add475 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -1897,10 +1897,21 @@ on_listbox_row_activated (GtkPlacesView *view, GtkWidget *listbox) { GtkPlacesViewPrivate *priv; + GdkEvent *event; + guint button; + GtkPlacesOpenFlags open_flags; priv = gtk_places_view_get_instance_private (view); - activate_row (view, row, priv->current_open_flags); + event = gtk_get_current_event (); + gdk_event_get_button (event, &button); + + if (gdk_event_get_event_type (event) == GDK_BUTTON_RELEASE && button == GDK_BUTTON_MIDDLE) + open_flags = GTK_PLACES_OPEN_NEW_TAB; + else + open_flags = priv->current_open_flags; + + activate_row (view, row, open_flags); } static gboolean